Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EncodingWarning on Python 3.10 #13510

Merged
merged 3 commits into from Feb 8, 2022

Conversation

gousaiyang
Copy link
Contributor

As per PEP 597, text files should always be opened with an explicitly specified encoding. Setting PYTHONWARNDEFAULTENCODING=1 on Python 3.10 will emit EncodingWarning to help find mistakes where encoding is omitted. This PR tries to address the problem mostly by explicitly specifying UTF-8 encoding. If there is any case where using the locale encoding is desired, we can further revise this PR.

@Carreau Carreau modified the milestones: 7.32, 8.0 Feb 7, 2022
@Carreau Carreau merged commit 0f4a73c into ipython:master Feb 8, 2022
@gousaiyang gousaiyang deleted the fix-3-10-encoding-warning branch February 9, 2022 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants